Remove empty Eshell commands when parsing
authorJim Porter <jporterbugs@gmail.com>
Sun, 9 Jun 2024 20:17:53 +0000 (13:17 -0700)
committerJim Porter <jporterbugs@gmail.com>
Sun, 9 Jun 2024 20:31:08 +0000 (13:31 -0700)
commit00649042f3057c9ea2e6a4944924293998e2a527
treeb4dc26b32a75a1bae997232f0b381fefcdfac64f
parent968bbdb317abf025e1d2cbd9dc5c20def7e3912a
Remove empty Eshell commands when parsing

This improves the logic for copying/stealing handles when constructing
the command form: now, we should always steal the handles for the last
real command, even if there were some trailing semicolons.

* lisp/eshell/esh-arg.el (eshell-parse-delimiter): Be stricter about
parsing so that things like "& &" aren't parsed as a single "&&" token.

* lisp/eshell/esh-cmd.el (eshell-parse-command): Get the commands in
reverse, and remove any nil commands.
(eshell-split-commands): Always return the trailing terms (except when
there were no terms to begin with).

* test/lisp/eshell/esh-cmd-tests.el
(esh-cmd-test/empty-background-command): New test.
lisp/eshell/esh-arg.el
lisp/eshell/esh-cmd.el
test/lisp/eshell/esh-cmd-tests.el